﻿using NUnit.Framework;
using Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Searching;
using Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.ViewModels;
using System;

namespace Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Tests.Unit.Searching
{
    [TestFixture]
    public class MesseageSearcherGeneratorTest
    {
        private MesseageSearcherGenerator testee;


        [SetUp]
        public void SetUp()
        {
            this.testee = new MesseageSearcherGenerator();
        }

        [Test]
        public void TestGenerate()
        {
            var searcher = this.testee.Generate("foo");
            Assert.IsTrue(searcher(new ProblemViewModel { Message = "Foo" }));
            Assert.IsTrue(searcher(new ProblemViewModel { Message = "xFoox" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Message = "Bar" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Message = "Fo" }));
        }
    }
}
